home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03030101.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  3.2 KB  |  39 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>DateSerial Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03030101"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="dateserial" xmlns:help="http://openoffice.org/2000/help">
  14.   <p class="Head1"><a name="dateserial"/><help:link Id="66424">DateSerial Function [Runtime]</help:link></p>
  15.   <p class="Paragraph">Returns a <span style="font-weight:bold;">Date</span> value for a specified year, month, and day.<a name="ende"/></p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.   <p class="Paragraph">DateSerial (year, month, day) <help:key-word value="DateSerial" tag="kw66424_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  20.   <p class="Paragraph">Date</p>
  21.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  22.   <p class="Paragraph">Year: Integer expression that indicates the year. All values between 0 and 99 are interpreted as the years 1900?1999. For other year arguments, you must enter all four digits.</p>
  23.   <p class="Paragraph">Month: Integer expression that indicates the month of the specified year. The accepted range is between 1 and 12.</p>
  24.   <p class="Paragraph">Day: Integer expression that indicates the day of the specified month. The accepted range is between 1 and 28, 29, 30 or 31 (depending on the number of days in the given month).</p>
  25.   <p class="Paragraph">The <span class="T1">DateSerial function</span> returns the number of days between December 30,1899 and the given date. You can use this function to calculate the difference between two dates.</p>
  26.   <p class="Paragraph">The function returns the data type Variant with VarType 7 (Date); internally, this value is stored as a Double value. Thus, 1.1.1900 results in the value 2. Negative values correspond to dates before December 30, 1899 (not inclusive).</p>
  27.   <p class="Paragraph">If a date is defined which lies outside of the accepted range, <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic returns an error message.</p>
  28.   <p class="Paragraph">The difference to the <span class="T1">DateValue function</span> is that there you define the function argument as a string which contains the date. In contrast, the <span class="T1">DateSerial function</span> evaluates each of the parameters (year, month, day) as separate numeric expressions.</p>
  29.   <p class="P2">Example:</p>
  30.   <p class="PropText">Sub ExampleDateSerial</p>
  31.   <p class="PropText">Dim lDate as Long</p>
  32.   <p class="PropText">Dim sDate as String</p>
  33.   <p class="PropText">lDate = DateSerial(1964, 4, 9)</p>
  34.   <p class="PropText">sDate = DateSerial(1964, 4, 9)</p>
  35.   <p class="PropText">msgbox lDate REM returns 23476</p>
  36.   <p class="PropText">msgbox sDate REM returns 09.04.1964 00:00:00</p>
  37.   <p class="PropText">end sub</p>
  38.   <p class="PropText"/>
  39.  </body></html>